<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<p><span id="time"></span>秒后自动跳转到百度</p>
		<script>
			function count(shijian, wangzhi) {
				var time = document.getElementById("time");
				time.innerHTML = shijian;
				if (--shijian > 0) {
					setTimeout(count, 1000, shijian, wangzhi)
				} else {
					location.href = wangzhi;
				}
			}
			count(9, "http://www.baidu.com");
		</script>
	</body>
</html>
